/*
 * XML Type:  SampleContact
 * Namespace: 
 * Java type: noNamespace.SampleContact
 *
 * Automatically generated - do not modify.
 */
package noNamespace.impl;
/**
 * An XML SampleContact(@).
 *
 * This is a complex type.
 */
public class SampleContactImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements noNamespace.SampleContact
{
    
    public SampleContactImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName RESIDENCEADDRESS$0 = 
        new javax.xml.namespace.QName("", "ResidenceAddress");
    private static final javax.xml.namespace.QName EMPLOYMENTADDRESS$2 = 
        new javax.xml.namespace.QName("", "EmploymentAddress");
    
    
    /**
     * Gets the "ResidenceAddress" element
     */
    public noNamespace.ResidenceAddress getResidenceAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.ResidenceAddress target = null;
            target = (noNamespace.ResidenceAddress)get_store().find_element_user(RESIDENCEADDRESS$0, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "ResidenceAddress" element
     */
    public boolean isSetResidenceAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(RESIDENCEADDRESS$0) != 0;
        }
    }
    
    /**
     * Sets the "ResidenceAddress" element
     */
    public void setResidenceAddress(noNamespace.ResidenceAddress residenceAddress)
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.ResidenceAddress target = null;
            target = (noNamespace.ResidenceAddress)get_store().find_element_user(RESIDENCEADDRESS$0, 0);
            if (target == null)
            {
                target = (noNamespace.ResidenceAddress)get_store().add_element_user(RESIDENCEADDRESS$0);
            }
            target.set(residenceAddress);
        }
    }
    
    /**
     * Appends and returns a new empty "ResidenceAddress" element
     */
    public noNamespace.ResidenceAddress addNewResidenceAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.ResidenceAddress target = null;
            target = (noNamespace.ResidenceAddress)get_store().add_element_user(RESIDENCEADDRESS$0);
            return target;
        }
    }
    
    /**
     * Unsets the "ResidenceAddress" element
     */
    public void unsetResidenceAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(RESIDENCEADDRESS$0, 0);
        }
    }
    
    /**
     * Gets the "EmploymentAddress" element
     */
    public noNamespace.EmploymentAddress getEmploymentAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.EmploymentAddress target = null;
            target = (noNamespace.EmploymentAddress)get_store().find_element_user(EMPLOYMENTADDRESS$2, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "EmploymentAddress" element
     */
    public boolean isSetEmploymentAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(EMPLOYMENTADDRESS$2) != 0;
        }
    }
    
    /**
     * Sets the "EmploymentAddress" element
     */
    public void setEmploymentAddress(noNamespace.EmploymentAddress employmentAddress)
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.EmploymentAddress target = null;
            target = (noNamespace.EmploymentAddress)get_store().find_element_user(EMPLOYMENTADDRESS$2, 0);
            if (target == null)
            {
                target = (noNamespace.EmploymentAddress)get_store().add_element_user(EMPLOYMENTADDRESS$2);
            }
            target.set(employmentAddress);
        }
    }
    
    /**
     * Appends and returns a new empty "EmploymentAddress" element
     */
    public noNamespace.EmploymentAddress addNewEmploymentAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            noNamespace.EmploymentAddress target = null;
            target = (noNamespace.EmploymentAddress)get_store().add_element_user(EMPLOYMENTADDRESS$2);
            return target;
        }
    }
    
    /**
     * Unsets the "EmploymentAddress" element
     */
    public void unsetEmploymentAddress()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(EMPLOYMENTADDRESS$2, 0);
        }
    }
}
